var pageParam = null;

$(function() {
	$('#vue_vm_list div').hide();
	
	var pageParamStr = $.url().param('pageParam');
	pageParam = JSON.parse(pageParamStr);
	showParamInfo(pageParam);
});

function showParamInfo(pageParam) {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list div').hide();
	$('#vue_vm_list').html(gl_vue_vm_list_html);
	
	new Vue({
		el: '#vue_vm_list',
		data: {
			todos: [pageParam]
		},
		methods: {
			getPayWayName:function(payWay) {
				var payWayName = '其他';
				
				switch(payWay) {
					case 1:
						payWayName = '现金';
						break;
					case 2:
						payWayName = '钱包扣费';
					  	break;
					case 3:
						payWayName = '五保免租金';
					  	break;
					case 4:
						payWayName = '五保免租金押金';
					  	break;
				}
				
				return payWayName;
			},
			
			dateDiff: function(sDate1, sDate2) {
				return DateDiff(sDate1, sDate2);
			},
			
			getNowDate: function() {
				return getNowFormatDate().substr(0,10);
			},
			
			getNowDiff: function(sDate1) {
				var nowDate = getNowFormatDate().substr(0,10);
				return DateDiff(sDate1, nowDate);
			},
			
			getNowDiffText: function(sDate1) {
				var nowDate = getNowFormatDate().substr(0,10);
				var nowDiff = DateDiff(sDate1, nowDate);
				return nowDiff>=0?'还有'+nowDiff+'天到期':'已经超期'+(-nowDiff)+'天';
			}
		}
	});
	
	$('#vue_vm_list div').show();
}

function deleteBatch() {
	deleteBatch_basic(path+'/lease/deleteBatch');
}
